import axios  from "axios";
import config from '@/config/config.js';

let menuRequest={
    getAll(callBack){
        // 获取token
        let token = localStorage.getItem("token");
        if(token){
            // 请求中携带token
            axios.get(config.sysBaseUrl + "/menu/list",{
                headers:{
                    token:token
                }
            }).then(res=>callBack(res.data));
        }else{
            callBack(undefined);
        }
    }
}

export default menuRequest;